﻿using System;

namespace PhiStore.ExampleCodes.PhiLog
{
    /// <summary>
    /// Class for a single Log entry
    /// </summary>
    [Serializable]
    public class LogEntry
    {
        private string ID;
        private string Message;
        private DateTime time;

        public LogEntry(string Identifier, string LogMessage)
        {
            time = DateTime.Now;
            ID = Identifier;
            Message = LogMessage;
        }

        public string Identifier
        {
            get { return ID; }
        }
        public string LogMessage
        {
            get { return Message; }
        }
        public DateTime LogEntryTime
        {
            get { return time; }
        }
        
        /// <summary>
        /// string representation of the log entry
        /// </summary>
        /// <returns>A string</returns>
        public override string ToString()
        {
            return "[" + time.ToLongTimeString() + "@" + ID + "] " + Message;
        }

    }
}
